package com.tiancheng.trade.settlement.service.settlement.impl;

import com.tiancheng.trade.commom.core.data.Result;
import com.tiancheng.trade.settlement.feign.FileUpload;
import com.tiancheng.trade.settlement.feign.dto.FilerUploadResult;
import com.tiancheng.trade.settlement.service.settlement.CommonService;
import jodd.util.StringUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;

/**
 * 公共service
 *
 * @author su
 */
@Slf4j
@Service
public class CommonServiceImpl implements CommonService {
    @Resource
    private FileUpload fileUpload;
    @Override
    public Result<FilerUploadResult> fileUpload(MultipartFile file, String readType) {
         return fileUpload.upload(file, StringUtil.isEmpty(readType) ? "AUTH_READ" : readType);
    }
}
